"""
对序列进行切片
"""
#对list进行切片
My_list = [0,1,2,3,4,5,6]
result =  My_list[1:4]
print(f"结果1:{result}")

#对tuple进行切片
my_tuple = (0,1,2,3,4,5,6)
result2 = my_tuple[:]
print(f"结果2:{result2}")

#对str进行切片,从头开始，最后结束，步长为2
my_str = "01234567"
result3 = my_str[::2]
print(f"结果3:{result3}")

#对str进行切片,从头开始，最后结束，步长为-1
my_str = "01234567"
result4 = my_str[::-1]
print(f"结果4:{result4}")

#对list进行切片
My_list = [0,1,2,3,4,5,6]
result5 =  My_list[3:1:-1]
print(f"结果5:{result5}")

#对tuple进行切片
my_tuple = (0,1,2,3,4,5,6)
result6 = my_tuple[::-2]
print(f"结果6:{result6}")